package ambientes;

import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.awt.SystemColor;
import java.text.Format;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFormattedTextField;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextPane;
import javax.swing.border.BevelBorder;
import javax.swing.border.EtchedBorder;
import javax.swing.border.LineBorder;

import agentes.PrincipioFundamentalContagemRegras;

public class PrincipioFundamentalContagemTabelaInterface extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = -646759208217349461L;

	PrincipioFundamentalContagemRegras regras = new PrincipioFundamentalContagemRegras();

	JPanel panel_2;
	JPanel panel_4;
	
	JLabel lblAjuda;


	JButton btnValida1;
	private JPanel panel;
	private JPanel panel_dica;
	private JButton btnDica;


	private JTextPane txtpnA;
	private JTextPane txtpnArranjo;
	private JTextPane txtpnA_1;
	private JTextPane txtpnA_2;
	private JTextPane txtpnA_3;
	private JTextPane txtpnN;
	private JTextPane txtpnP;
	private JTextPane txtpnTotalDePossibilidades;

	private JTabbedPane tabbedPane;

	public PrincipioFundamentalContagemTabelaInterface() {
		setBackground(Color.WHITE);
		setAlignmentY(Component.TOP_ALIGNMENT);
		setAlignmentX(Component.LEFT_ALIGNMENT);
		setLayout(null);
		setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));

		tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane.setBounds(12, 12, 956, 550);
		add(tabbedPane);
		
		
		JPanel panel_1 = new BackgroundPanel();
		panel_1.setBorder(new EtchedBorder(EtchedBorder.RAISED, null, null));
		panel_1.setLayout(null);
		panel_1.setBackground(new Color(255, 255, 255, 240));
		panel_1.setBounds(74, 12, 839, 105);
		//tabbedPane.add(panel_1, "Enunciado");

		JPanel panel_1_1 = new JPanel();
		panel_1_1.setBounds(34, 26, 841, 472);
		panel_1_1.setBackground(new Color(255, 255, 255, 240));
		panel_1_1.setLayout(null);

		JTextPane txtpnEnunciado = new JTextPane();
		txtpnEnunciado.setFont(new Font("Dialog", Font.PLAIN, 14));
		txtpnEnunciado.setContentType("text/html");
		txtpnEnunciado.setOpaque(false);
		txtpnEnunciado.setBounds(12, 12, 806, 433);
		txtpnEnunciado.setEditable(false);
		txtpnEnunciado
				.setText("Calcule abaixo a arranjo, através do <b><u>princípio fundamental da contagem</u></b>, "
						+ "do exercício anterior :<br><br>"
						+ "<b>4(quatro) bandas</b> distintas concorrendo a <b>2(duas) vagas</b>, "
						+ "com disitinção entre a primeira e segunda colocação.<br><br><br><br><hr><br><br>" +
						"O princípio fundamental da contagem"
						+ " nos diz que sempre devemos multiplicar os números de opções<br>"
						+ " entre as escolhas que podemos fazer. <br><br>"
						+ "Por exemplo, para montar um computador, temos:" +
						"<ul><li> 3 tipos de monitores</li><li>4 tipos de teclados</li><li>2 tipos de impressora e 3 tipos de CPU</li></ul> <br>"
						+ "Para saber o numero de diferentes possibilidades de computadores"
						+ "que podem ser montados com essas peças,"
						+ "somente multiplicamos as opções: <br><br>"
						+ "3 x 4 x 2 x 3 = 72 possibilidades de configurações diferentes.");
		panel_1_1.add(txtpnEnunciado);
		panel_1.add(panel_1_1);

		panel = new BackgroundPanel();
		panel.setBounds(0, 0, 284, 420);
		panel.setBorder(new EtchedBorder(EtchedBorder.RAISED, null, null));
		panel.setLayout(null);
		tabbedPane.add(panel, "Exercício");
		

		panel_dica = new JPanel();
		panel_dica.setBounds(591, 25, 308, 442);
		panel.add(panel_dica);
		panel_dica.setBorder(new EtchedBorder(EtchedBorder.RAISED, null, null));
		panel_dica.setBackground(new Color(255, 255, 255, 240));
		panel_dica.setLayout(null);

		lblAjuda = new JLabel("");
		lblAjuda.setBounds(228, 12, 56, 50);
		panel_dica.add(lblAjuda);
		lblAjuda.setIcon(new ImageIcon(
				PrincipioFundamentalContagemInterface.class
						.getResource("/images/dica.png")));

		btnDica = new JButton("Mais Dicas!");
		btnDica.setBounds(12, 12, 114, 25);
		panel_dica.add(btnDica);

		JTextPane txtpnCasoPreciseDe = new JTextPane();
		txtpnCasoPreciseDe.setBorder(new BevelBorder(BevelBorder.LOWERED, null,
				null, null, null));
		txtpnCasoPreciseDe.setEditable(false);
		txtpnCasoPreciseDe
				.setText("Caso precise de ajuda, clique em \"Mais Dicas!\".");
		txtpnCasoPreciseDe.setBounds(22, 75, 250, 313);
		panel_dica.add(txtpnCasoPreciseDe);

		panel_2 = new JPanel();
		panel_2.setBounds(31, 25, 536, 442);
		panel.add(panel_2);
		panel_2.setBorder(new EtchedBorder(EtchedBorder.RAISED, null, null));
		panel_2.setLayout(null);
		panel_2.setBackground(new Color(255, 255, 255, 240));

		JPanel panel_3 = new JPanel();
		panel_3.setBorder(new LineBorder(new Color(0, 0, 0)));
		panel_3.setForeground(new Color(255, 255, 255));
		panel_3.setBackground(new Color(153, 153, 153));
		panel_3.setBounds(12, 12, 507, 62);
		panel_2.add(panel_3);
		panel_3.setLayout(null);

		txtpnArranjo = new JTextPane();
		txtpnArranjo.setForeground(new Color(255, 255, 255));
		txtpnArranjo.setBackground(new Color(153, 153, 153));
		txtpnArranjo.setBounds(12, 25, 70, 25);
		panel_3.add(txtpnArranjo);
		txtpnArranjo.setFont(new Font("Dialog", Font.BOLD, 16));
		txtpnArranjo.setText("Arranjo");

		txtpnN = new JTextPane();
		txtpnN.setForeground(new Color(255, 255, 255));
		txtpnN.setBackground(new Color(153, 153, 153));
		txtpnN.setBounds(116, 27, 28, 21);
		panel_3.add(txtpnN);
		txtpnN.setFont(new Font("Dialog", Font.BOLD, 16));
		txtpnN.setText("n");

		txtpnP = new JTextPane();
		txtpnP.setForeground(new Color(255, 255, 255));
		txtpnP.setBackground(new Color(153, 153, 153));
		txtpnP.setBounds(178, 27, 28, 21);
		panel_3.add(txtpnP);
		txtpnP.setFont(new Font("Dialog", Font.BOLD, 16));
		txtpnP.setText("p");

		txtpnTotalDePossibilidades = new JTextPane();
		txtpnTotalDePossibilidades.setForeground(new Color(255, 255, 255));
		txtpnTotalDePossibilidades.setBackground(new Color(153, 153, 153));
		txtpnTotalDePossibilidades.setBounds(240, 27, 211, 21);
		panel_3.add(txtpnTotalDePossibilidades);
		txtpnTotalDePossibilidades.setFont(new Font("Dialog", Font.BOLD, 16));
		txtpnTotalDePossibilidades.setText("Total de possibilidades");

		panel_4 = new JPanel();
		panel_4.setBorder(new LineBorder(new Color(0, 0, 0)));
		panel_4.setBackground(SystemColor.window);
		panel_4.setBounds(12, 86, 507, 319);
		panel_2.add(panel_4);
		panel_4.setLayout(null);

		txtpnA = new JTextPane();
		txtpnA.setBackground(SystemColor.window);
		txtpnA.setBounds(12, 37, 76, 21);
		panel_4.add(txtpnA);
		txtpnA.setFont(new Font("Dialog", Font.BOLD, 14));
		txtpnA.setText("A(1,1) = ");

		JFormattedTextField formattedTextField_1 = new JFormattedTextField(
				(Format) null);
		formattedTextField_1.setBounds(100, 35, 63, 25);
		panel_4.add(formattedTextField_1);
		formattedTextField_1.setFont(new Font("Dialog", Font.PLAIN, 14));
		formattedTextField_1.setColumns(10);

		JFormattedTextField formattedTextField_2 = new JFormattedTextField(
				(Format) null);
		formattedTextField_2.setBounds(176, 35, 63, 25);
		panel_4.add(formattedTextField_2);
		formattedTextField_2.setFont(new Font("Dialog", Font.PLAIN, 14));
		formattedTextField_2.setColumns(10);

		JFormattedTextField formattedTextField_3 = new JFormattedTextField(
				(Format) null);
		formattedTextField_3.setBounds(288, 35, 63, 25);
		panel_4.add(formattedTextField_3);
		formattedTextField_3.setFont(new Font("Dialog", Font.PLAIN, 14));
		formattedTextField_3.setColumns(10);

		btnValida1 = new JButton("Validar");
		btnValida1.setBounds(406, 35, 88, 25);
		panel_4.add(btnValida1);
		btnValida1.setFont(new Font("Dialog", Font.BOLD, 14));
		btnValida1.setActionCommand("Validar");

		txtpnA_1 = new JTextPane();
		txtpnA_1.setBackground(SystemColor.window);
		txtpnA_1.setBounds(12, 111, 76, 21);
		panel_4.add(txtpnA_1);
		txtpnA_1.setFont(new Font("Dialog", Font.BOLD, 14));
		txtpnA_1.setText("A(2,2) = ");

		JFormattedTextField formattedTextField_4 = new JFormattedTextField(
				(Format) null);
		formattedTextField_4.setBounds(100, 109, 63, 25);
		panel_4.add(formattedTextField_4);
		formattedTextField_4.setFont(new Font("Dialog", Font.PLAIN, 14));
		formattedTextField_4.setColumns(10);

		JFormattedTextField formattedTextField_5 = new JFormattedTextField(
				(Format) null);
		formattedTextField_5.setBounds(176, 109, 63, 25);
		panel_4.add(formattedTextField_5);
		formattedTextField_5.setFont(new Font("Dialog", Font.PLAIN, 14));
		formattedTextField_5.setColumns(10);

		JFormattedTextField formattedTextField_6 = new JFormattedTextField(
				(Format) null);
		formattedTextField_6.setBounds(288, 109, 63, 25);
		panel_4.add(formattedTextField_6);
		formattedTextField_6.setFont(new Font("Dialog", Font.PLAIN, 14));
		formattedTextField_6.setColumns(10);

		txtpnA_2 = new JTextPane();
		txtpnA_2.setBackground(SystemColor.window);
		txtpnA_2.setBounds(12, 182, 76, 21);
		panel_4.add(txtpnA_2);
		txtpnA_2.setFont(new Font("Dialog", Font.BOLD, 14));
		txtpnA_2.setText("A(3,2) = ");

		JFormattedTextField formattedTextField_7 = new JFormattedTextField(
				(Format) null);
		formattedTextField_7.setBounds(100, 180, 63, 25);
		panel_4.add(formattedTextField_7);
		formattedTextField_7.setFont(new Font("Dialog", Font.PLAIN, 14));
		formattedTextField_7.setColumns(10);

		JFormattedTextField formattedTextField_8 = new JFormattedTextField(
				(Format) null);
		formattedTextField_8.setBounds(176, 180, 63, 25);
		panel_4.add(formattedTextField_8);
		formattedTextField_8.setFont(new Font("Dialog", Font.PLAIN, 14));
		formattedTextField_8.setColumns(10);

		JFormattedTextField formattedTextField_9 = new JFormattedTextField(
				(Format) null);
		formattedTextField_9.setBounds(288, 180, 63, 25);
		panel_4.add(formattedTextField_9);
		formattedTextField_9.setFont(new Font("Dialog", Font.PLAIN, 14));
		formattedTextField_9.setColumns(10);

		txtpnA_3 = new JTextPane();
		txtpnA_3.setBackground(SystemColor.window);
		txtpnA_3.setBounds(12, 255, 76, 21);
		panel_4.add(txtpnA_3);
		txtpnA_3.setFont(new Font("Dialog", Font.BOLD, 14));
		txtpnA_3.setText("A(4,2) = ");

		JFormattedTextField formattedTextField_10 = new JFormattedTextField(
				(Format) null);
		formattedTextField_10.setBounds(100, 253, 63, 25);
		panel_4.add(formattedTextField_10);
		formattedTextField_10.setFont(new Font("Dialog", Font.PLAIN, 14));
		formattedTextField_10.setColumns(10);

		JFormattedTextField formattedTextField_11 = new JFormattedTextField(
				(Format) null);
		formattedTextField_11.setBounds(176, 253, 63, 25);
		panel_4.add(formattedTextField_11);
		formattedTextField_11.setFont(new Font("Dialog", Font.PLAIN, 14));
		formattedTextField_11.setColumns(10);

		JFormattedTextField formattedTextField_12 = new JFormattedTextField(
				(Format) null);
		formattedTextField_12.setBounds(288, 253, 63, 25);
		panel_4.add(formattedTextField_12);
		formattedTextField_12.setFont(new Font("Dialog", Font.PLAIN, 14));
		formattedTextField_12.setColumns(10);

		JButton button = new JButton("Validar");
		button.setFont(new Font("Dialog", Font.BOLD, 14));
		button.setActionCommand("Validar");
		button.setBounds(406, 107, 88, 25);
		panel_4.add(button);

		JButton button_1 = new JButton("Validar");
		button_1.setFont(new Font("Dialog", Font.BOLD, 14));
		button_1.setActionCommand("Validar");
		button_1.setBounds(406, 178, 88, 25);
		panel_4.add(button_1);

		JButton button_2 = new JButton("Validar");
		button_2.setFont(new Font("Dialog", Font.BOLD, 14));
		button_2.setActionCommand("Validar");
		button_2.setBounds(406, 251, 88, 25);
		panel_4.add(button_2);

	}
	
	
	public JPanel getPanel(){
		return panel_4;
	}
}
